package com.icart.entities;

import javax.persistence.*;

@Entity
@Table(name = "bi_servpackbelong", schema = "ams", catalog = "")
@IdClass(BiServpackbelongEntityPK.class)
public class BiServpackbelongEntity {
    private String belongcode;
    private long packid;

    @Id
    @Column(name = "belongcode")
    public String getBelongcode() {
        return belongcode;
    }

    public void setBelongcode(String belongcode) {
        this.belongcode = belongcode;
    }

    @Id
    @Column(name = "packid")
    public long getPackid() {
        return packid;
    }

    public void setPackid(long packid) {
        this.packid = packid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BiServpackbelongEntity that = (BiServpackbelongEntity) o;

        if (packid != that.packid) return false;
        if (belongcode != null ? !belongcode.equals(that.belongcode) : that.belongcode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = belongcode != null ? belongcode.hashCode() : 0;
        result = 31 * result + (int) (packid ^ (packid >>> 32));
        return result;
    }
}
